package com.senbai.springlearning.ioclearn;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class IocLearn {

    public static void main(String args[]) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
        String className = "com.senbai.springlearning.ioclearn.Say";

        Class clazz = Class.forName(className);
        Say say =(Say) clazz.newInstance();
        Method method = clazz.getMethod("sayHello", String.class);
        method.invoke(say,"Mike");

        return;

    }
}
